//
//  OAMainAddressViewController.m
//  OASystem
//
//  Created by zhoupengfei on 15/12/6.
//  Copyright © 2015年 zpf. All rights reserved.
//
#import "OANameListController.h"

#import "OAMainAddressViewController.h"
#import "OAExpendViewController.h"
#import "OACountyTableViewController.h"
@interface OAMainAddressViewController ()

@end

@implementation OAMainAddressViewController

-(void)viewDidLoad{
    self.title = @"选择人员";
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
   
    if (indexPath.row == 0) {
        OACountyTableViewController * countyVC = (OACountyTableViewController*)[self.storyboard instantiateViewControllerWithIdentifier:@"countyVCID"];
        [self.navigationController pushViewController:countyVC animated:YES];
        
    }else if (indexPath.row == 1) {
//         OAExpendViewController * expendVC = [[OAExpendViewController alloc] init];
//        expendVC.type = UnitDataType;
////         expendVC.identifierString = @"txsfb";
//         [self.navigationController pushViewController:expendVC animated:YES];
        OANameListController * listVC = (OANameListController*)[self.storyboard instantiateViewControllerWithIdentifier:@"NameLIstID"];
    listVC.delegate = self;
        listVC.type = @"UnitDataType";

//    self.namelist = listVC;
    [self.navigationController pushViewController:listVC animated:YES];
    }else if (indexPath.row == 2){
         OAExpendViewController * expendVC = [[OAExpendViewController alloc] init];
        expendVC.type = DepartmentDataType;
        [self.navigationController pushViewController:expendVC animated:YES];
    }
    
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    if (self.addressType == LessMainAddressType && indexPath.row == 2) {
        return 0;
    }
    return 44;
}


@end
